package com.baizhi.feignclient;

import com.baizhi.feignclient.hystrix.HystrixClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

// fallback：这个属性用来指定当前调用服务不可用时，默认的备选处理
@FeignClient(value = "HYSTRIX", fallback = HystrixClientFallback.class)
// @FeignClient(value = "HYSTRIX", fallbackFactory = HystrixClientFallbackFactory.class)
public interface HystrixClient {

    @GetMapping("/demo")
    String demo(@RequestParam("id") Integer id);
}
